<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>绿地养护</title>
	<meta name="viewport"
		content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<link rel="stylesheet" type="text/css" href="../../css/api.css" />
	<link rel="stylesheet" type="text/css" href="../../css/globle.css" />
	<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
	<link rel="stylesheet" type="text/css" href="../../css/common.css" />
	<style>
		body {
			padding-top: 25px;
		}

		span {
			margin: 10px;
		}

		.Tabl {
			height: 50px;
			width: 88%;
			font-size: 14px;
			font-weight: bold;
			text-align: left;
			margin-left: 6%;
		}

		.Td1 {
			color: #B8B8B8;
			font-weight: bold;
			width: 70px;
			font-size: 13px;
		}

		.Td2 {

			text-align: left;
			width: 80px;
			color: rgb(85, 85, 85);
			font-size: 13px;
		}

		.Hr {
			height: 1px;
			width: 96%;
			background-color: #D8D8D8;
			margin-left: 2%;
		}

		.Butt {
			border: 1px solid #B8B8B8;
			border-radius: 20px;
			color: #FFFFFF;
			height: 17px;
			width: 17px;
			outline: none;
		}

		.TabImg {
			height: 150px;
			width: 96%;
			margin-left: 2%;
			border: 10px solid #D8D8D8;
		}

		.TdImg1 {
			height: 110px;
			width: 90px;
		}

		.TdImg2 {
			height: 110px;
			width: 90px;
		}

		.ButAdd {
			height: 110px;
			width: 100px;
			font-size: 100px;
			color: #FFFFFF;
			background-color: #B8B8B8;
		}

		.TabL {
			height: 75px;
			width: 88%;
			font-size: 16px;
			font-weight: bold;
			text-align: left;
			margin-left: 6%;
		}

		.ButL {
			height: 40px;
			width: 100%;
			background-color: #D0D0D0;
			position: fixed;
			bottom: 0;
		}

		.Td3 {
			text-align: center;
			width: 50%;
		}

		select {
			appearance: none;
			-moz-appearance: none;
			-webkit-appearance: none;
			border: none;
			background: none;
		}
	</style>
</head>

<body>
	<table class="Tabl" style="margin-top: -20px">
		<tr>
			<td class="Td1">日期</td>
			<td class="Td2" id="att_time"> </td>
		</tr>
	</table>
	<hr class="Hr" />
	<button style="background-color: #F2F2F2;height: 40px;width: 100%;font-size: 18px;">上午健康信息</button>
	<hr class="Hr" />
	<div id="detailed"></div>
	<div>
		<label style="font-size: 16px;color: #B8B8B8;margin-left: 10px;">上午图片:</label><img onclick="showBig(this)" id="ampt"
			style="width:100px;height:100px" />
		<label style="font-size: 16px;color: #B8B8B8;">下午图片:</label><img onclick="showBig(this)" id="pmpt"
			style="width:100px;height:100px" />

	</div>

	<div style="width: 80%;position: absolute;left: 10%;right: 10; top: 20%;z-index: 1000000;text-align: center;"
		id="bigImage"></div>


</body>
<script src="../../script/webuploader.min.js"></script>
<script src="../../script/diyUpload.js"></script>
<script src="../../script/jquery.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript">
	apiready = function () {
		var id = api.pageParam.id;
		//片区id
		var areaid = null;
		var reg = $api.getStorage("userSession");
		var sids = reg.data.sysRole.sysRoleCode;
		var role = sids.role_number;
		if (role != "construction") {
			areaid = $api.getStorage("selectpor").id;
		} else {
			areaid = reg.data.areaid;
		}
		//项目id
		var proid = $api.getStorage('userSession').data.proId;

		//获取详情
		$.ajax({
			type: "post",
			//async : false, //同步执行
			url: BaseServiceUrl + "mobile/healthy/view.json",
			data: {
				id: id
			},
			dataType: "json", //返回数据形式为json
			success: function (result) {
				var data = result.data
				$("#att_time").html(data.h_createDate);
				$("#ampt").attr('src', BaseServiceUrl + data.a_am_picture);
				$("#pmpt").attr('src', BaseServiceUrl + data.a_pm_picture);
			}
		});
		var teamid = $api.getStorage('userSession').data.team_id
		//查找该施工账号下所有成员
		$.ajax({
			url: BaseServiceUrl + "mobile/healthy/findMember.json",
			type: "POST",
			data: {
				'tid': teamid,
			},
			dataType: "json",
			success: function (retee) {
				var datalength = retee.data.length;
				//查找该施工账号下所有成员
				$.ajax({
					url: BaseServiceUrl + "mobile/healthy/findHealthymember.json",
					type: "POST",
					data: {
						'h_id': id,
					},
					dataType: "json",
					success: function (ret) {
						var num = 0;
						var h = "";
						var data = ret.data
						for (var i = 0; i < data.length; i++) {
							num++;
							var h_blood_yes = "";
							var h_temperature_yes = "";
							var twcolor = "";
							var xycolor = "";
							if (data[i].h_blood_yes == 0) {
								h_blood_yes = "正常";
								xycolor = '#000';
							} else {
								h_blood_yes = "异常";
								xycolor = 'red';
							}
							if (data[i].h_temperature_yes == 0) {
								h_temperature_yes = "正常";
								twcolor = '#000'
							} else {
								h_temperature_yes = "异常";
								twcolor = 'red';
							}
							if (datalength == i) {
								h += "<hr class='Hr' />" +
									"<button style='background-color: #F2F2F2;height: 40px;width: 100%;font-size: 18px;''>下午健康信息</button>" +
									"<hr class='Hr' />" +
									"<table class='Tabl' style='margin-top: 5px'><tr>" +
									"<td class='Td1'>姓名</td>" +
									"<td class='Td2'>" + data[i].h_name + "</td>" +
									"</tr>" +
									"<tr>" +
									"<td class='Td1'>体温状态</td>" +
									"<td class='Td2' style='color:"+twcolor+"'>" + h_temperature_yes + "</td>" +
									"</tr>" +
									"<tr>" +
									"<td class='Td1'>血压状态</td>" +
									"<td class='Td2' style='color:"+xycolor+"'>" + h_blood_yes + "</td>" +
									"</tr>" +
									"<tr>" +
									"</tr>" +
									"<tr style='height: 20px'>" +
									"<td class='Td1'></td>" +
									"<td class='Td2'></td>" +
									"</tr></table><hr class='Hr'/>"
							} else {
								h += "<table class='Tabl' style='margin-top: 5px'><tr>" +
									"<td class='Td1'>姓名</td>" +
									"<td class='Td2'>" + data[i].h_name + "</td>" +
									"</tr>" +
									"<tr>" +
									"<td class='Td1'>体温状态</td>" +
									"<td class='Td2' style='color:"+twcolor+"'>" + h_temperature_yes + "</td>" +
									"</tr>" +
									"<tr>" +
									"<td class='Td1'>血压状态</td>" +
									"<td class='Td2' style='color:"+xycolor+"'>" + h_blood_yes + "</td>" +
									"</tr>" +
									"<tr>" +
									"</tr>" +
									"<tr style='height: 20px'>" +
									"<td class='Td1'></td>" +
									"<td class='Td2'></td>" +
									"</tr></table><hr class='Hr'/>"
							}

						}

						$("#detailed").append(h);
					},
					error: function (jqXHR, textStatus, errorThrown) {}
				});
			},
			error: function (jqXHR, textStatus, errorThrown) {}
		});

	};

	function showBig(t) {
		document.getElementById("bigImage").innerHTML =
			"<img src='" +
			t.src +
			"' onclick='closeBig(this)'  width='100%' style='border:3px solid #4f4f4f;'/>";
	}

	function closeBig(t) {
		document.getElementById("bigImage").innerHTML = "";
	}

	function showBig1(t) {
		document.getElementById("bigImage1").innerHTML =
			"<img src='" +
			t.src +
			"' onclick='closeBig1(this)'  width='100%' style='border:3px solid #4f4f4f;'/>";
	}

	function closeBig1(t) {
		document.getElementById("bigImage1").innerHTML = "";
	}
</script>

</html>